﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ObviousCode.Aspect.PluginLibrary.Interfaces;
using ObviousCode.Aspect.PluginLibrary.Caches;
using ObviousCode.UI.Aspect.PluginLibrary.Interfaces;
using ObviousCode.Common.Utils.Library.Dictionaries;

namespace ObviousCode.UI.Aspect.Persistence.AspectMenu
{
    public class MenuSaver_V1 : MenuSaver
    {
        protected override void PerformSave(ObviousCode.Aspect.PluginLibrary.Interfaces.IAspectMenu menu)
        {
            PropertyArray surfaceObjects = new PropertyArray();
            
            Dictionary.Set("surface-objects", surfaceObjects);

            foreach (ISurfaceObject item in menu.Collection)
            {
                surfaceObjects.Append(item.InstanceKey);
            }
        }

        public override int Version
        {
            get { return 1; }
        }
    }
}
